package com.cy.study.task;

import com.cy.study.service.PushRecordService;
import com.cy.study.service.UserPlanService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
@Slf4j
public class UpdatePlanTask {

    private final UserPlanService userPlanService;
    private final PushRecordService pushRecordService;


    //@Scheduled(cron = "0 0 0 * * ?")
    @Scheduled(fixedRate = 1000000)
    //@Scheduled(cron = "0/10 * * * * ?")
    public void updatePlan() {
        log.info("开始更新用户推送状态");
        pushRecordService.autoPushPlan();
    }

}
